package com.lyy.controller;


import com.lyy.annotation.SkipToken;
import com.lyy.entity.Banner;
import com.lyy.result.Result;
import com.lyy.service.BannerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Liangyaoyun
 */
//@RestController=@Controller+@ResponseBody(返回json数据)

@RestController
@RequestMapping("/api/v1/banner")
@Tag(name = "Banner接口")
public class BannerController {
    @Autowired
    public BannerService bannerService;

    @Operation(summary = "查询轮播图记录", description = "查询前N条轮播图片记录")
    @GetMapping("/list/{top}")
    public Result list(@PathVariable Integer top){
        return new Result(bannerService.top(top));
    }
}
